<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 110px;
                text-align: right;
            }

            .col-label2 {
                width: 110px;
                text-align: right;
            }

            .col-input {
                width: 30px;
            }

            .col-input-200 {
                width: 120px;
            }

            .msg-font-color {
                color: red;
            }

        </style>
        <script type="text/javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.id != 'editForm:btnSaveAdd' &amp;&amp; event.srcElement.id != 'editForm:btnSaveEdit')
                        event.keyCode = 9;
                }
            }
            function rtnScript(rtnflag,exmsg) {
                if (rtnflag == "true") {
                    alert("操作成功！");
                    window.returnValue = "1";
                    window.close();
                } else {
                    alert("操作失败:" + exmsg);
                }
            }

        </script>
        <base target="_self"/>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px 15px 5px 15px">
            <h:form id="editForm">
                <h:outputText id="rntFlag" escape="false" value="#{actinfoDetlAction.rtnmsg}"/>
                <p:fieldset legend="账户详细">
                    <h:panelGrid id="detailPanel1" columns="1" cellpadding="3">
                        <h:panelGrid columns="6" cellpadding="2" border="0"
                                     columnClasses="col-label,col-input,,col-label2,col-input">
                            <h:outputLabel value="账号:"/>
                            <p:inputText id="txtactno" value="#{actinfoDetlAction.selectedRecord.actno}" size="30"
                                         style="width:150px;"
                                         disabled="#{actinfoDetlAction.opertype.equals('select')}"
                                         required="true" requiredMessage="不能为空"/>
                            <h:message for="txtactno" styleClass="msg-font-color"></h:message>
                            <h:outputLabel value="户名:"/>
                            <p:inputText id="txtactname" value="#{actinfoDetlAction.selectedRecord.actname}" size="30"
                                         style="width:150px;"
                                         disabled="#{actinfoDetlAction.opertype.equals('select')}"
                                         required="true" requiredMessage="不能为空"/>
                            <h:message for="txtactname" styleClass="msg-font-color"></h:message>
                            <h:outputLabel value="账户类型:"/>
                            <h:selectOneMenu value="#{actinfoDetlAction.selectedRecord.acttype}" style="width:150px;"
                                             id="selActtype"
                                             disabled="#{actinfoDetlAction.opertype.equals('select')}">
                                <f:selectItems value="#{actinfoDetlAction.actTypeItemList}"></f:selectItems>
                            </h:selectOneMenu>
                            <h:outputLabel/>
                            <h:outputLabel value="备注:"/>
                            <p:inputText value="#{actinfoDetlAction.selectedRecord.remark}" size="30"
                                         style="width:150px;"
                                         disabled="#{actinfoDetlAction.opertype.equals('select')}"/>
                            <h:outputLabel/>
                        </h:panelGrid>
                        <h:panelGrid rendered="#{actinfoDetlAction.opertype.equals('select')}" columns="6"
                                     cellpadding="2" border="0"
                                     columnClasses="col-label,col-input,,col-label2,col-input,">
                            <h:outputLabel value="删除标志:"/>
                            <p:inputText value="#{actinfoDetlAction.selectedRecord.deletedFlag}" size="30"
                                         style="width:150px;"
                                         disabled="true"/>
                            <h:outputLabel/>
                            <h:outputLabel value="创建人:"/>
                            <p:inputText value="#{actinfoDetlAction.selectedRecord.createdBy}" size="30"
                                         style="width:150px;"
                                         disabled="true"/>
                            <h:outputLabel/>
                            <h:outputLabel value="创建时间:"/>
                            <p:inputText value="#{actinfoDetlAction.selectedRecord.createdDate}" size="30"
                                         style="width:150px;"
                                         disabled="true">
                                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>
                            </p:inputText>
                            <h:outputLabel/>
                            <h:outputLabel value="最后修改人:"/>
                            <p:inputText value="#{actinfoDetlAction.selectedRecord.lastUpdBy}" size="30"
                                         style="width:150px;"
                                         disabled="true"/>
                            <h:outputLabel/>
                            <h:outputLabel value="最后修改时间:"/>
                            <p:inputText value="#{actinfoDetlAction.selectedRecord.lastUpdDate}" size="30"
                                         style="width:150px;"
                                         disabled="true">
                                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="GMT+8"/>
                            </p:inputText>
                            <h:outputLabel/>
                        </h:panelGrid>
                        <h:panelGrid columns="1" cellpadding="2" border="0" style="width:700px;text-align:center;">
                            <h:panelGroup>
                                <h:commandButton rendered="#{actinfoDetlAction.opertype.equals('add')}" id="btnSaveAdd"
                                                 ajax="true" value="添加"
                                                 action="#{actinfoDetlAction.onBtnSaveAddClick}"
                                                 style="width:90px">
                                </h:commandButton>
                                <h:commandButton rendered="#{actinfoDetlAction.opertype.equals('edit')}"
                                                 id="btnSaveEdit" ajax="true" value="修改"
                                                 action="#{actinfoDetlAction.onBtnSaveEditClick}"
                                                 style="width:90px">
                                </h:commandButton>
                                <p:spacer width="10px"/>
                                <h:commandButton ajax="true" immediate="true"
                                                 onclick="window.close();return false;" value="关闭"
                                                 style="width:90px"/>
                            </h:panelGroup>

                        </h:panelGrid>
                    </h:panelGrid>


                </p:fieldset>
                <p:separator style="margin-top:15px;"/>
                <p:fieldset  rendered="#{!actinfoDetlAction.opertype.equals('add')}" legend="操作日志">
                    <p:dataTable id="logpdt" style="margin-top:5px;"
                                 value="#{actinfoDetlAction.logList}" var="log"
                                 emptyMessage="日志记录为空...">
                        <p:column id="jobname" headerText="操作动作" style="text-align:center">
                            <h:outputText value="#{log.jobname}"/>
                        </p:column>
                        <p:column id="jobdesc" headerText="操作日志">
                            <h:outputText value="#{log.jobdesc}"/>
                        </p:column>
                        <p:column id="jobusername" headerText="操作人员" style="text-align:center">
                            <h:outputText value="#{log.jobusername}"/>
                        </p:column>
                        <p:column id="jobtime" headerText="操作时间" style="text-align:center">
                            <h:outputText value="#{log.jobtime}">
                                <f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss" timeZone="GMT+8"/>
                            </h:outputText>
                        </p:column>

                    </p:dataTable>
                </p:fieldset>
            </h:form>
        </div>
    </ui:define>

</ui:composition>